package com.lsfb.signsys;


import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.lsfb.signsys.compatible.LsfbLog;

import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * Created by zgscwjm on 2018/3/29.
 */

public abstract class BaseFragment extends Fragment {


    protected View view;

    protected Unbinder unbinder;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        if (null == view) {
            view = inflater.inflate(getContentView(), container, false);
            unbinder = ButterKnife.bind(this, view);
            init();
        }
        return view;
    }


    @Override
    public void onDestroyView() {
        super.onDestroyView();
        if (null!=unbinder) {
            unbinder.unbind();
        }
    }

    public abstract int getContentView();

    public abstract void init();


    @Override
    public void onStart() {
        super.onStart();
        LsfbLog.e("liftState---onStart");
    }

    @Override
    public void onResume() {
        super.onResume();
        LsfbLog.e("liftState---onResume");
    }

    @Override
    public void onPause() {
        super.onPause();
        LsfbLog.e("liftState---onPause");
    }



    @Override
    public void onStop() {
        super.onStop();
        LsfbLog.e("liftState---onStop");
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        LsfbLog.e("liftState---onDestroy");
    }


}
